package com.gopay.common.domain.ptbank;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Version;


import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * Entity: 资金变动明细文件
 */
@Entity
@Table(name = "GSRT_BANK_HF_TD_FUND_DTL")
public class GsrtBankHfTdFundDtl implements java.io.Serializable {
	
	/**
     * 
     * @Description 上传文本数据项坐标
     * @author zyt
     * @date 2016年05月03日
     *
     */
    public enum UploadCoordinate {
    	TRANSDATE(0, "transdate", "交易日期"), 
    	PLATID(1, "platid", "平台编号"),
    	MERCUSTID(2, "mercustid", "支付机构平台编号"), 
    	CASHC(3, "cashc", "应付可提现资金"),
        CASHD(4, "cashd", "应收可提现资金"), 
        BONDC(5, "bondc", "应付风险准备金"),
        BONDD(6, "bondd", "应收风险准备金 "), 
        FEEC(7, "feec", "应付托管费金额"),
        FEED(8, "feed", "应收托管费金额"), 
        FEE(9, "fee", "银行手续费"),
        EVEUNFROZENMONEY(10, "eveunfrozenmoney", "前日解冻资金 "), 
        OFFSETBAL(11, "offsetbal", "轧差");
    	
        private int coordinate;
        private String field;
        private String comments;

        private UploadCoordinate(int coordinate, String field, String comments) {
            this.coordinate = coordinate;
            this.field = field;
            this.comments = comments;
        }

        public static Map<Integer, String> getTextCoordinate() {
            Map<Integer, String> map = new HashMap<>();
            for (UploadCoordinate uploadCoordinate : UploadCoordinate.values()) {
                map.put(uploadCoordinate.getCoordinate(), uploadCoordinate.getField());
            }
            return map;
        }
        
        public static Map<Integer, String> getCommentsCoordinate() {
            Map<Integer, String> map = new HashMap<>();
            for (UploadCoordinate uploadCoordinate : UploadCoordinate.values()) {
                map.put(uploadCoordinate.getCoordinate(), uploadCoordinate.getComments());
            }
            return map;
        }
        
        public static String getCommentsByCoordinate(int coordinate) {
            for (UploadCoordinate uploadCoordinate : UploadCoordinate.values()) {
                if (uploadCoordinate.getCoordinate() == coordinate) {
                    return uploadCoordinate.comments;
                }
            }
            return null;
        }

        public int getCoordinate() {
            return coordinate;
        }

        public void setCoordinate(int coordinate) {
            this.coordinate = coordinate;
        }

        public String getField() {
            return field;
        }

        public void setField(String field) {
            this.field = field;
        }

        public String getComments() {
            return comments;
        }

        public void setComments(String comments) {
            this.comments = comments;
        }

    }

    /**
     * 
     * @Description 下载文本数据项坐标
     * @author zyt
     * @date 2016年05月03日
     *
     */
    public enum DownloadCoordinate {
    	
    	TRANSDATE(1, "transdate", "交易日期"), 
    	PLATID(2, "platid", "平台编号");
    	
        private int coordinate;
        private String field;
        private String comments;

        private DownloadCoordinate(int coordinate, String field, String comments) {
            this.coordinate = coordinate;
            this.field = field;
            this.comments = comments;
        }

        public static Map<Integer, String> getTextCoordinate() {
            Map<Integer, String> map = new HashMap<>();
            for (DownloadCoordinate downloadCoordinate : DownloadCoordinate.values()) {
                map.put(downloadCoordinate.getCoordinate(), downloadCoordinate.getField());
            }
            return map;
        }
        
        public static Map<Integer, String> getCommentsCoordinate() {
            Map<Integer, String> map = new HashMap<>();
            for (DownloadCoordinate downloadCoordinate : DownloadCoordinate.values()) {
                map.put(downloadCoordinate.getCoordinate(), downloadCoordinate.getComments());
            }
            return map;
        }
        
        public static String getCommentsByCoordinate(int coordinate) {
            for (DownloadCoordinate downloadCoordinate : DownloadCoordinate.values()) {
                if (downloadCoordinate.getCoordinate() == coordinate) {
                    return downloadCoordinate.comments;
                }
            }
            return null;
        }

        public int getCoordinate() {
            return coordinate;
        }

        public void setCoordinate(int coordinate) {
            this.coordinate = coordinate;
        }

        public String getField() {
            return field;
        }

        public void setField(String field) {
            this.field = field;
        }

        public String getComments() {
            return comments;
        }

        public void setComments(String comments) {
            this.comments = comments;
        }

    }
    
	private static final long serialVersionUID = 1L;

	/** 
	 * id
	 */
	private Long id;

	/** 
	 * 乐观锁版本号
	 */
	private Long version;

	/** 
	 * 客户id
	 */
	private String custid;

	/** 
	 * 国付宝交易时间
	 */
	private String gopayTxnTm;

	private String orderid;

	private String platid;

	private String natdate;

	private String nattime;

	private String filename;

	/** 
	 * 交易日期
	 */
	private String transdate;

	/** 
	 * 支付机构标的ID
	 */
	private String proid;

	private String paymentid;

	/** 
	 * 支付机构平台编号
	 */
	private String mercustid;

	/** 
	 * 应付可提现资金
	 */
	private BigDecimal cashc;

	/** 
	 * 应收可提现资金
	 */
	private BigDecimal cashd;

	/** 
	 * 应付风险准备金
	 */
	private BigDecimal bondc;

	/** 
	 * 应收风险准备金
	 */
	private BigDecimal bondd;

	/** 
	 * 应付托管费金额
	 */
	private BigDecimal feec;

	/** 
	 * 应收托管费金额
	 */
	private BigDecimal feed;

	/** 
	 * 银行手续费
	 */
	private BigDecimal fee;

	/** 
	 * 当前冻结资金累计
	 */
	private BigDecimal totalfrozenmoney;

	/** 
	 * 前日解冻资金
	 */
	private BigDecimal eveunfrozenmoney;

	/** 
	 * 轧差
	 */
	private BigDecimal offsetbal;

	private String cashliqid;

	private String feeliqid;

	private String resv1;

	private String resv2;

	private String resv3;

	private String resv4;

	private String commentRk;

	/** 
	 * 发送银行状态
	已发送：01；
	未发送：02   ；
	发送失败：03 ；
	发送中：04
	 */
	private String bankstate;

	/** 
	 * 创建时间
	 */
	private Date createdTs;

	/** 
	 * 记录最后修改时间
	 */
	private Date lastUpdTs;

	private String remark;

	private String remark2;

	private String remark3;

	public GsrtBankHfTdFundDtl() {
	}

	public GsrtBankHfTdFundDtl(Long id, Long version, String custid, String gopayTxnTm, String orderid, String platid,
							   String natdate, String nattime, String filename, String transdate, String proid,
							   String paymentid, String mercustid, BigDecimal cashc, BigDecimal cashd, BigDecimal bondc,
							   BigDecimal bondd, BigDecimal feec, BigDecimal feed, BigDecimal fee,
							   BigDecimal totalfrozenmoney, BigDecimal eveunfrozenmoney, BigDecimal offsetbal,
							   String cashliqid, String feeliqid, String resv1, String resv2, String resv3, String resv4,
							   String commentRk, String bankstate, Date createdTs, Date lastUpdTs, String remark,
							   String remark2, String remark3) {
		this.id = id;
		this.version = version;
		this.custid = custid;
		this.gopayTxnTm = gopayTxnTm;
		this.orderid = orderid;
		this.platid = platid;
		this.natdate = natdate;
		this.nattime = nattime;
		this.filename = filename;
		this.transdate = transdate;
		this.proid = proid;
		this.paymentid = paymentid;
		this.mercustid = mercustid;
		this.cashc = cashc;
		this.cashd = cashd;
		this.bondc = bondc;
		this.bondd = bondd;
		this.feec = feec;
		this.feed = feed;
		this.fee = fee;
		this.totalfrozenmoney = totalfrozenmoney;
		this.eveunfrozenmoney = eveunfrozenmoney;
		this.offsetbal = offsetbal;
		this.cashliqid = cashliqid;
		this.feeliqid = feeliqid;
		this.resv1 = resv1;
		this.resv2 = resv2;
		this.resv3 = resv3;
		this.resv4 = resv4;
		this.commentRk = commentRk;
		this.bankstate = bankstate;
		this.createdTs = createdTs;
		this.lastUpdTs = lastUpdTs;
		this.remark = remark;
		this.remark2 = remark2;
		this.remark3 = remark3;
	}

	@Id
	@SequenceGenerator(name = "GsrtBankHfTdFundDtlSequence", sequenceName = "GSRT_BANK_HF_TD_FUND_DTL_SEQ")
	@GeneratedValue(generator = "GsrtBankHfTdFundDtlSequence", strategy = GenerationType.SEQUENCE)
	@Column(name = "ID", unique = true, nullable = false, precision = 22, scale = 0)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Version
	@Column(name = "VERSION", precision = 22, scale = 0)
	public Long getVersion() {
		return this.version;
	}

	public void setVersion(Long version) {
		this.version = version;
	}

	@Column(name = "CUSTID", length = 10)
	public String getCustid() {
		return this.custid;
	}

	public void setCustid(String custid) {
		this.custid = custid;
	}

	@Column(name = "GOPAY_TXN_TM", length = 8)
	public String getGopayTxnTm() {
		return this.gopayTxnTm;
	}

	public void setGopayTxnTm(String gopayTxnTm) {
		this.gopayTxnTm = gopayTxnTm;
	}

	@Column(name = "ORDERID", nullable = false, length = 32)
	public String getOrderid() {
		return this.orderid;
	}

	public void setOrderid(String orderid) {
		this.orderid = orderid;
	}

	@Column(name = "PLATID", nullable = false, length = 32)
	public String getPlatid() {
		return this.platid;
	}

	public void setPlatid(String platid) {
		this.platid = platid;
	}

	@Column(name = "NATDATE", nullable = false, length = 8)
	public String getNatdate() {
		return this.natdate;
	}

	public void setNatdate(String natdate) {
		this.natdate = natdate;
	}

	@Column(name = "NATTIME", nullable = false, length = 6)
	public String getNattime() {
		return this.nattime;
	}

	public void setNattime(String nattime) {
		this.nattime = nattime;
	}

	@Column(name = "FILENAME", length = 20)
	public String getFilename() {
		return this.filename;
	}

	public void setFilename(String filename) {
		this.filename = filename;
	}

	@Column(name = "TRANSDATE", nullable = false, length = 8)
	public String getTransdate() {
		return this.transdate;
	}

	public void setTransdate(String transdate) {
		this.transdate = transdate;
	}

	@Column(name = "PROID", nullable = false, length = 20)
	public String getProid() {
		return this.proid;
	}

	public void setProid(String proid) {
		this.proid = proid;
	}

	@Column(name = "PAYMENTID", nullable = false, length = 32)
	public String getPaymentid() {
		return this.paymentid;
	}

	public void setPaymentid(String paymentid) {
		this.paymentid = paymentid;
	}

	@Column(name = "MERCUSTID", length = 32)
	public String getMercustid() {
		return this.mercustid;
	}

	public void setMercustid(String mercustid) {
		this.mercustid = mercustid;
	}

	@Column(name = "CASHC", precision = 16)
	public BigDecimal getCashc() {
		return this.cashc;
	}

	public void setCashc(BigDecimal cashc) {
		this.cashc = cashc;
	}

	@Column(name = "CASHD", precision = 16)
	public BigDecimal getCashd() {
		return this.cashd;
	}

	public void setCashd(BigDecimal cashd) {
		this.cashd = cashd;
	}

	@Column(name = "BONDC", precision = 16)
	public BigDecimal getBondc() {
		return this.bondc;
	}

	public void setBondc(BigDecimal bondc) {
		this.bondc = bondc;
	}

	@Column(name = "BONDD", precision = 16)
	public BigDecimal getBondd() {
		return this.bondd;
	}

	public void setBondd(BigDecimal bondd) {
		this.bondd = bondd;
	}

	@Column(name = "FEEC", precision = 16)
	public BigDecimal getFeec() {
		return this.feec;
	}

	public void setFeec(BigDecimal feec) {
		this.feec = feec;
	}

	@Column(name = "FEED", precision = 16)
	public BigDecimal getFeed() {
		return this.feed;
	}

	public void setFeed(BigDecimal feed) {
		this.feed = feed;
	}

	@Column(name = "FEE", precision = 16)
	public BigDecimal getFee() {
		return this.fee;
	}

	public void setFee(BigDecimal fee) {
		this.fee = fee;
	}

	@Column(name = "TOTALFROZENMONEY", precision = 16)
	public BigDecimal getTotalfrozenmoney() {
		return this.totalfrozenmoney;
	}

	public void setTotalfrozenmoney(BigDecimal totalfrozenmoney) {
		this.totalfrozenmoney = totalfrozenmoney;
	}

	@Column(name = "EVEUNFROZENMONEY", precision = 16)
	public BigDecimal getEveunfrozenmoney() {
		return this.eveunfrozenmoney;
	}

	public void setEveunfrozenmoney(BigDecimal eveunfrozenmoney) {
		this.eveunfrozenmoney = eveunfrozenmoney;
	}

	@Column(name = "OFFSETBAL", precision = 16)
	public BigDecimal getOffsetbal() {
		return this.offsetbal;
	}

	public void setOffsetbal(BigDecimal offsetbal) {
		this.offsetbal = offsetbal;
	}

	@Column(name = "CASHLIQID", length = 32)
	public String getCashliqid() {
		return this.cashliqid;
	}

	public void setCashliqid(String cashliqid) {
		this.cashliqid = cashliqid;
	}

	@Column(name = "FEELIQID", length = 32)
	public String getFeeliqid() {
		return this.feeliqid;
	}

	public void setFeeliqid(String feeliqid) {
		this.feeliqid = feeliqid;
	}

	@Column(name = "RESV1", length = 30)
	public String getResv1() {
		return this.resv1;
	}

	public void setResv1(String resv1) {
		this.resv1 = resv1;
	}

	@Column(name = "RESV2", length = 30)
	public String getResv2() {
		return this.resv2;
	}

	public void setResv2(String resv2) {
		this.resv2 = resv2;
	}

	@Column(name = "RESV3", length = 60)
	public String getResv3() {
		return this.resv3;
	}

	public void setResv3(String resv3) {
		this.resv3 = resv3;
	}

	@Column(name = "RESV4", length = 60)
	public String getResv4() {
		return this.resv4;
	}

	public void setResv4(String resv4) {
		this.resv4 = resv4;
	}

	@Column(name = "COMMENT_RK", length = 50)
	public String getCommentRk() {
		return this.commentRk;
	}

	public void setCommentRk(String commentRk) {
		this.commentRk = commentRk;
	}

	@Column(name = "BANKSTATE", length = 2)
	public String getBankstate() {
		return this.bankstate;
	}

	public void setBankstate(String bankstate) {
		this.bankstate = bankstate;
	}

	@Column(name = "CREATED_TS", nullable = false)
	public Date getCreatedTs() {
		return this.createdTs;
	}

	public void setCreatedTs(Date createdTs) {
		this.createdTs = createdTs;
	}

	@Column(name = "LAST_UPD_TS", nullable = false)
	public Date getLastUpdTs() {
		return this.lastUpdTs;
	}

	public void setLastUpdTs(Date lastUpdTs) {
		this.lastUpdTs = lastUpdTs;
	}

	@Column(name = "REMARK", length = 50)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "REMARK2", length = 50)
	public String getRemark2() {
		return this.remark2;
	}

	public void setRemark2(String remark2) {
		this.remark2 = remark2;
	}

	@Column(name = "REMARK3", length = 50)
	public String getRemark3() {
		return this.remark3;
	}

	public void setRemark3(String remark3) {
		this.remark3 = remark3;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
	}
}
